<%= dropdown do %>
  <%= dropdown_toggle class: 'btn-light dropdown-toggle' do %>
    <span class="text-muted font-weight-normal">Show:</span>
    <%= gift_cards_filter_dropdown_value %>
  <% end %>
  <%= dropdown_menu do %>

    <%= active_link_to Spree.t('admin.gift_cards.all_statuses'), params.to_unsafe_h.deep_merge({page: nil, q: {active: nil, expired: nil, redeemed: nil, partially_redeemed: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[active expired redeemed partially_redeemed] ).all?(&:blank?) %>
    
    <%= link_to Spree.t('admin.gift_cards.active'),
      params.to_unsafe_h.deep_merge({page: nil, q: {active: true, expired: nil, redeemed: nil, partially_redeemed: nil}}),
      class: "dropdown-item #{'active' if params[:q] && params[:q][:active].present?}" %>
    
    <%= link_to params.to_unsafe_h.deep_merge({page: nil, q: {expired: true, active: nil, redeemed: nil, partially_redeemed: nil}}),
      class: "dropdown-item #{'active' if params[:q] && params[:q][:expired].present?}" do %>
        <%= Spree.t(:expired) %>
    <% end %>

    <%= link_to params.to_unsafe_h.deep_merge({page: nil, q: {redeemed: true, active: nil, expired: nil, partially_redeemed: nil}}),
      class: "dropdown-item #{'active' if params[:q] && params[:q][:redeemed].present?}" do %>
        <%= Spree.t('admin.gift_cards.redeemed') %>
    <% end %>

  <% end %>
<% end %>
